import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AcupointVO, AcupointForm, AcupointQuery } from '@/api/system/acupoint/types';

/**
 * 查询穴位信息列表
 * @param query
 * @returns {*}
 */

export const listAcupoint = (query?: AcupointQuery): AxiosPromise<AcupointVO[]> => {
  return request({
    url: '/system/acupoint/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询穴位信息详细
 * @param acupointId
 */
export const getAcupoint = (acupointId: string | number): AxiosPromise<AcupointVO> => {
  return request({
    url: '/system/acupoint/' + acupointId,
    method: 'get'
  });
};

/**
 * 查询穴位信息
 * @param data
 */
export const queryAcupointlist = (data: AcupointForm) => {
  return request({
    url: '/system/acupoint/queryAcupointlist',
    method: 'post',
    data: data
  });
};

/**
 * 新增穴位信息
 * @param data
 */
export const addAcupoint = (data: AcupointForm) => {
  return request({
    url: '/system/acupoint',
    method: 'post',
    data: data
  });
};

/**
 * 修改穴位信息
 * @param data
 */
export const updateAcupoint = (data: AcupointForm) => {
  return request({
    url: '/system/acupoint',
    method: 'put',
    data: data
  });
};

/**
 * 删除穴位信息
 * @param acupointId
 */
export const delAcupoint = (acupointId: string | number | Array<string | number>) => {
  return request({
    url: '/system/acupoint/' + acupointId,
    method: 'delete'
  });
};
